﻿using Archiecture.API.Application.Commands.DeepCommand;
using Architercture.Domain.Service.IService;
using MediatR;
using Swork03_28.Domain.TraceableInfos;

namespace Archiecture.API.Application.CommandHandlers.DeepCommandHandler
{
    public class GetDeepProcessCommandHandler : IRequestHandler<GetDeepProcessCommand, DeepProcess>
    {
        private readonly IDeepProcessService _deepSerivce;

        public GetDeepProcessCommandHandler(IDeepProcessService deepSerivce)
        {
            _deepSerivce = deepSerivce;
        }

        async Task<DeepProcess> IRequestHandler<GetDeepProcessCommand, DeepProcess>.Handle(GetDeepProcessCommand request, CancellationToken cancellationToken)
        {
            return await _deepSerivce.GetDeepProcessInfo(request.batchCode);
        }
    }
}
